Ext.define('CMS.controllers.logup.LogupWinLinkController',{

    extend:'Ext.app.ViewController',
    alias:'controller.LogupWinLinkController',

    onLinkButtonClick:function(button,event){
/*        this.getView().destroy();
        Ext.create({
            xtype:'LogupWinMain'
        });*/

        var me=this,
            window=me.getView(),
            form=window.down('form');
        var formValues = form.getValues();
        Ext.Ajax.request({
            method: 'post',
            url: 'http://localhost:8080/logup/testAliAccount.do',
            params: formValues,
            success:function(response,options){
                if(Ext.util.JSON.decode(response.responseText)==true){
                    //Ext.Msg.alert('成功', '从服务端获取结果: ' + response.responseText);
                    //this.getView().destroy();
                    Ext.Msg.alert('欢迎','验证成功');
                    window.destroy();
                    Ext.create({
                        xtype:'LogupWinMain'
                    });
                }else{
                    Ext.Msg.alert('登录失败','账号或者密码错误');
                }

                // Ext.Msg.alert('成功', '从服务端获取结果: ' + response.responseText);
            },
            failure:function(response,options){
                Ext.Msg.alert('失败', '验证失败' + response.status);
            }
        });

    },


    onLinkReturnButtonClick:function (button,event) {
        this.getView().destroy();
        Ext.create({
            xtype:'LoginWin'
        });
    }

})